import Vue from 'vue';
import Router from 'vue-router';
import {routeGenerator} from "./api_server/common/routeGenerator";

//正常的业务路由
import articleList from '~/pages/web/articleList.vue';
import articleInfo from '~/pages/web/articleInfo.vue';


Vue.use(Router)
export async function createRouter() {
  let routers = [
    {
      path: '/',
      component: articleList,
    },
    {
      path: '/:id(\\d+)',
      component: articleInfo
    },
  ]
  await routeGenerator(routers);
  return new Router({
    mode: 'history',
    routes: routers
  })
}
